import request from '@/utils/request'
import API from './constants'

const getHomeData = () => request({
  url: API.API_TAB + '/1',
  method: 'GET',
  params: {
    start: 0,
  },
})

const getBanners = () => request({
  url: API.API_TAB + '/1',
  method: 'GET',
  params: {
    start: 0,
  },
  headers: {
    'x-platform': 'pc',
  },
})
  .then(data => data.banners)
// 爆款商品
const getItems = (start = 0) => request({
  url: API.API_BAOKUAN,
  params: {
    start,
  },
})

export {
  getBanners,
  getItems,
  getHomeData,
}
